<template>
    <section>
        <el-col :span="24">
            <el-form inline>
                <el-form-item>
                    <el-input size="small" v-model.trim="form.allocation_number" placeholder="单号, 多个请用“逗号”隔开" style="width: 250px;" clearable></el-input>
                </el-form-item>
                <el-form-item>
                    <el-input size="small" v-model.trim="form.adduser" placeholder="发起人" style="width: 110px;" clearable></el-input>
                </el-form-item>
                <el-form-item>
                    <el-select v-model="form.status" placeholder="审批状态" size="small" style="width: 110px" clearable>
                        <el-option :value=0 label="审核中"></el-option>
                        <el-option :value=1 label="已通过"></el-option>
                        <el-option :value=2 label="已拒绝"></el-option>
                        <el-option :value=3 label="已撤回"></el-option>
                        <el-option :value=4 label="已撤销"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item>
                    <el-popover placement="bottom" width="450" trigger="click">
                        <el-form label-width="80px" label-position="left">
                            <el-form-item label="联系电话">
                                <el-input size="small" v-model.trim="form.wp_phone" placeholder="联系电话（收件人）" style="width: 80%;" clearable></el-input>
                            </el-form-item>
                            <el-form-item label="联系人">
                                <el-input size="small" v-model.trim="form.wp_user" placeholder="联系人（收件人）" style="width: 80%;" clearable></el-input>
                            </el-form-item>
                            <el-form-item label="发起时间">
                                <el-date-picker value-format="yyyy-MM-dd" v-model="form.createtime" type="daterange" size="small" style="width: 80%"
                                                range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
                            </el-form-item>
                        </el-form>
                        <el-button slot="reference" size="small" type="warning" plain>更多</el-button>
                    </el-popover>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" class="el-icon-search" @click="searchBtn" size="small" :loading="btnLoading">查询</el-button>
                </el-form-item>
            </el-form>
        </el-col>
        <el-col :span="24">
            <el-table :data="data" style="width: 100%" :max-height="tableHeight" v-loading="loading" size="small">
                <el-table-column type="expand">
                    <template slot-scope="{row}">
                        <el-form label-position="left" class="demo-table-expand" size="mini">
                            <el-form-item label="借出单号：" v-if="row.types==1">
                                {{row.jc_number}}
                            </el-form-item>
                            <el-form-item label="收件信息：">
                                <div v-if="row.wp_user && row.wp_phone && row.wp_address">
                                    {{ row.wp_user + "，" }} {{ row.wp_phone + "，"
                                    }}{{ row.wp_province }}{{ row.wp_city }}{{ row.wp_area
                                    }}{{ row.wp_address }}
                                </div>
                            </el-form-item>
                            <el-form-item label="sku编码：">
                                <template v-for="(sku_code, index) in row.sku_codes">
                                    <el-tag size="mini">{{sku_code}}</el-tag>&nbsp;
                                </template>
                            </el-form-item>
                        </el-form>
                    </template>
                </el-table-column>
                <el-table-column prop="allocation_number" label="单号" width="170"></el-table-column>
                <el-table-column prop="approval_id" label="审批id" show-overflow-tooltip></el-table-column>
                <el-table-column prop="types" label="类型" width="90">
                    <template slot-scope="{ row }">
                        <el-tag v-if="row.types==1" type="warning" size="mini">转内购</el-tag>
                        <el-tag v-else size="mini">内购</el-tag>
                    </template>
                </el-table-column>
                <el-table-column prop="adduser" label="发起人" width="80"></el-table-column>
                <el-table-column prop="createtime" label="发起时间" width="135"></el-table-column>
                <el-table-column prop="total_num" label="内购总数" width="100"></el-table-column>
                <el-table-column prop="total_price" label="原价总金额"></el-table-column>
                <el-table-column label="折扣" prop="discount"></el-table-column>
                <el-table-column prop="discount_amount" label="折扣总金额"></el-table-column>
                <el-table-column prop="status" label="审核状态">
                    <template slot-scope="{ row }">
                        <el-tag size="mini" v-if="row.status==0">审核中</el-tag>
                        <el-tag size="mini" v-else-if="row.status==1" type="success">已通过</el-tag>
                        <el-tag size="mini" v-else-if="row.status==2" type="danger">已拒绝</el-tag>
                        <el-tag size="mini" v-else-if="row.status==3" type="warning">已撤回</el-tag>
                        <el-tag size="mini" v-else-if="row.status==4" type="info">已撤销</el-tag>
                        <el-tag size="mini" v-else>{{ row.status }}</el-tag>
                    </template>
                </el-table-column>
                <el-table-column prop="is_push" label="推送状态">
                    <template slot-scope="{ row }">
                        <el-tag size="mini" v-if="row.is_push==0" type="info">未推送</el-tag>
                        <el-tag size="mini" v-else-if="row.is_push==1" type="success">成功</el-tag>
                        <el-tag size="mini" v-else-if="row.is_push==2" type="danger">失败</el-tag>
                        <el-tag size="mini" v-else-if="row.is_push==3" type="warning">取消</el-tag>
                        <el-tag size="mini" v-else>{{ row.is_push }}</el-tag>
                    </template>
                </el-table-column>
                <el-table-column label="操作" fixed="right" width="150">
                    <template scope="{ row }">
                        <el-button class="el-icon-document" type="text" size="small" @click="detailBtn(row.allocation_number)">&nbsp;详情</el-button>
                        <el-button class="el-icon-share" type="text" size="small" @click="processBtn(row)"  :disabled="!(row.approval_id)">&nbsp;审批进度</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <!--翻页栏-->
            <div style="margin-top: 4px;overflow: hidden;float: right;">
                <Page :total="total" :current="page" :page-size="limit" show-total @on-change="pageChange"></Page>
            </div>
        </el-col>

        <!--内购详情-->
        <el-drawer title="内购详情" :visible.sync="detailVisible" size="1200px" direction="rtl" :wrapperClosable="false">
            <el-row style="padding: 0 20px;overflow-y: auto" :style="{'height':drawerTableHeight}">
                <div>
                    <svg t="1717659283335" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9445" width="16" height="16"><path d="M407.466667 477.866667h-277.333334C93.866667 477.866667 64 448 64 409.6v-277.333333c0-36.266667 29.866667-66.133333 66.133333-66.133334h277.333334c36.266667 0 66.133333 29.866667 66.133333 66.133334v277.333333c2.133333 38.4-27.733333 68.266667-66.133333 68.266667zM132.266667 108.8c-12.8 0-25.6 10.666667-25.6 25.6v277.333333c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333333c0-12.8-10.666667-25.6-25.6-25.6h-277.333333zM407.466667 960h-277.333334C93.866667 960 64 930.133333 64 893.866667v-277.333334c0-36.266667 29.866667-66.133333 66.133333-66.133333h277.333334c36.266667 0 66.133333 29.866667 66.133333 66.133333v277.333334c2.133333 36.266667-27.733333 66.133333-66.133333 66.133333zM132.266667 590.933333c-12.8 0-25.6 10.666667-25.6 25.6v277.333334c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333334c0-12.8-10.666667-25.6-25.6-25.6h-277.333333z m618.666666-110.933333c-17.066667 0-34.133333-6.4-46.933333-19.2L563.2 320c-12.8-12.8-19.2-29.866667-19.2-46.933333s6.4-34.133333 19.2-46.933334L704 83.2c12.8-12.8 29.866667-19.2 46.933333-19.2 17.066667 0 34.133333 6.4 46.933334 19.2l140.8 140.8c12.8 12.8 19.2 29.866667 19.2 46.933333 0 17.066667-6.4 34.133333-19.2 46.933334l-138.666667 142.933333c-12.8 12.8-29.866667 19.2-49.066667 19.2z m0-373.333333c-6.4 0-12.8 2.133333-17.066666 6.4l-140.8 140.8c-4.266667 4.266667-6.4 10.666667-6.4 17.066666 0 6.4 2.133333 12.8 6.4 17.066667l140.8 140.8c4.266667 4.266667 10.666667 6.4 17.066666 6.4 6.4 0 12.8-2.133333 17.066667-6.4l140.8-140.8c4.266667-4.266667 6.4-10.666667 6.4-17.066667 0-6.4-2.133333-12.8-6.4-17.066666L768 113.066667c-4.266667-4.266667-8.533333-6.4-17.066667-6.4z m138.666667 853.333333h-277.333333c-36.266667 0-66.133333-29.866667-66.133334-66.133333v-277.333334c0-36.266667 29.866667-66.133333 66.133334-66.133333h277.333333c36.266667 0 66.133333 29.866667 66.133333 66.133333v277.333334c2.133333 36.266667-27.733333 66.133333-66.133333 66.133333zM614.4 590.933333c-12.8 0-25.6 10.666667-25.6 25.6v277.333334c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333334c0-12.8-10.666667-25.6-25.6-25.6h-277.333333z" fill="#1E87EB" p-id="9446"></path></svg>
                    <span style="font-size: 16px;font-weight: bold;vertical-align: bottom;margin-left: 4px;">商品信息：{{detail.allocation_number}}</span>
                </div>
                <el-row style="width: 100%;border-top: 1px solid #ebeef5;border-left: 1px solid #ebeef5;border-right: 1px solid #ebeef5;">
                    <el-row style="height: 40px;padding: 10px;background-color: #f5f7fa;">
                        <span style="font-weight: bold;color: #909399">申请计划列表</span>
                        <span style="float: right">
                            总内购数量：<span style="font-weight: bold;font-size: 14px;color: #409eff;margin-right: 20px;">{{detail.total_num}}</span>
                            原价总金额：<span style="font-weight: bold;font-size: 14px;margin-right: 20px;">{{detail.total_price}}</span>
                            折扣：<span style="font-weight: bold;font-size: 14px;margin-right: 20px;">{{detail.discount}}</span>
                            折后总金额(元)：<span style="font-weight: bold;font-size: 14px;color: #ed4014;margin-right: 20px;">{{detail.discount_amount}}</span>
                            <el-tag size="mini" v-if="detail.status==0">审核中</el-tag>
                            <el-tag size="mini" v-else-if="detail.status==1" type="success">已通过</el-tag>
                            <el-tag size="mini" v-else-if="detail.status==2" type="danger">已拒绝</el-tag>
                            <el-tag size="mini" v-else-if="detail.status==3" type="warning">已撤回</el-tag>
                            <el-tag size="mini" v-else-if="detail.status==4" type="warning">已撤销</el-tag>
                            <el-tag size="mini" v-else>{{ detail.status }}</el-tag>
                        </span>
                    </el-row>
                    <el-table v-if="detail.list" :data="detail.list" style="width: 100%" max-height="400px" size="mini">
                        <el-table-column prop="img" label="图片" width="50">
                            <template slot-scope="{row}">
                                <el-image :src="row.img" fit="contian" :preview-src-list="[row.img]">
                                    <div slot="error" class="image-slot">
                                        <svg t="1718681716906" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2623" width="20" height="20"><path d="M400.696 268.795c-17.249 0-31.233 13.986-31.233 31.233v30.471c0 17.249 13.986 31.233 31.233 31.233s31.233-13.986 31.233-31.233v-30.471c0-17.249-13.985-31.233-31.233-31.233z" fill="#999999" p-id="2624"></path><path d="M623.649 361.734c17.249 0 31.234-13.986 31.234-31.233v-30.471c0-17.249-13.986-31.233-31.234-31.233s-31.233 13.986-31.233 31.233v30.471c-0.001 17.248 13.985 31.233 31.233 31.233z" fill="#999999" p-id="2625"></path><path d="M438.295 388.804c-14.656 9.104-19.155 28.362-10.050 43.013 11.209 18.047 41.976 48.59 86.157 48.59 43.958 0 75.1-30.313 86.574-48.223 9.303-14.529 5.068-33.847-9.455-43.15-14.539-9.298-33.852-5.068-43.15 9.455-0.122 0.199-13.38 19.45-33.969 19.45-20.009 0-32.444-18.128-33.278-19.373-9.166-14.423-28.28-18.805-42.829-9.761z" fill="#999999" p-id="2626"></path><path d="M824.508503 116.690676 571.592236 116.690676c-17.248849 0-31.233352 13.985526-31.233352 31.233352s13.985526 31.233352 31.233352 31.233352l252.916267 0c40.181141 0 72.878844 32.692586 72.878844 72.878844l0 396.966057-189.334159-165.29465c-12.20088-10.655687-30.517037-10.207479-42.173518 0.9967L468.578048 674.16231 309.521472 517.519714c-11.895935-11.70253-30.903847-12.002358-43.154869-0.645706L126.957507 646.163629l0-394.126382c0-40.186258 32.692586-72.878844 72.878844-72.878844l252.916267 0c17.248849 0 31.233352-13.985526 31.233352-31.233352S470.000444 116.690676 452.751594 116.690676L199.836351 116.690676c-74.632791 0-135.346571 60.71378-135.346571 135.346571l0 520.56405c0 74.632791 60.71378 135.346571 135.346571 135.346571l252.916267 0c17.248849 0 31.233352-13.985526 31.233352-31.233352s-13.985526-31.233352-31.233352-31.233352L199.836351 845.481164c-40.186258 0-72.878844-32.692586-72.878844-72.878844l0-41.23924 160.003134-148.385539 159.428036 157.007917c12.048407 11.865235 31.361265 11.981892 43.546795 0.274246l198.576661-190.68697 208.876238 182.346001 0 40.683585c0 40.186258-32.697703 72.878844-72.878844 72.878844L571.592236 845.481164c-17.248849 0-31.233352 13.985526-31.233352 31.233352s13.985526 31.233352 31.233352 31.233352l252.916267 0c74.627674 0 135.346571-60.71378 135.346571-135.346571L959.855074 252.037247C959.855074 177.404456 899.136178 116.690676 824.508503 116.690676z" fill="#999999" p-id="2627"></path></svg>
                                    </div>
                                </el-image>
                            </template>
                        </el-table-column>
                        <el-table-column prop="type_name" label="款名" show-overflow-tooltip></el-table-column>
                        <el-table-column prop="sku_code" label="规格编码" width="140"></el-table-column>
                        <el-table-column prop="price" label="单价"></el-table-column>
                        <el-table-column label="折扣">
                            <template>{{detail.discount}}</template>
                        </el-table-column>
                        <el-table-column prop="num" label="内购数量">
                            <template slot-scope="{row}">
                                <span style="font-size: 16px;font-weight: bold">{{row.num}}</span>
                            </template>
                        </el-table-column>
                        <el-table-column prop="discount_amount" label="折后金额"></el-table-column>
                        <el-table-column label="发起人" width="80"><template>{{detail.adduser}}</template></el-table-column>
                        <el-table-column label="发起时间" width="140"><template>{{detail.createtime}}</template></el-table-column>
                    </el-table>
                </el-row>
                <div style="margin-top: 10px;">
                    <svg t="1717659283335" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9445" width="16" height="16"><path d="M407.466667 477.866667h-277.333334C93.866667 477.866667 64 448 64 409.6v-277.333333c0-36.266667 29.866667-66.133333 66.133333-66.133334h277.333334c36.266667 0 66.133333 29.866667 66.133333 66.133334v277.333333c2.133333 38.4-27.733333 68.266667-66.133333 68.266667zM132.266667 108.8c-12.8 0-25.6 10.666667-25.6 25.6v277.333333c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333333c0-12.8-10.666667-25.6-25.6-25.6h-277.333333zM407.466667 960h-277.333334C93.866667 960 64 930.133333 64 893.866667v-277.333334c0-36.266667 29.866667-66.133333 66.133333-66.133333h277.333334c36.266667 0 66.133333 29.866667 66.133333 66.133333v277.333334c2.133333 36.266667-27.733333 66.133333-66.133333 66.133333zM132.266667 590.933333c-12.8 0-25.6 10.666667-25.6 25.6v277.333334c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333334c0-12.8-10.666667-25.6-25.6-25.6h-277.333333z m618.666666-110.933333c-17.066667 0-34.133333-6.4-46.933333-19.2L563.2 320c-12.8-12.8-19.2-29.866667-19.2-46.933333s6.4-34.133333 19.2-46.933334L704 83.2c12.8-12.8 29.866667-19.2 46.933333-19.2 17.066667 0 34.133333 6.4 46.933334 19.2l140.8 140.8c12.8 12.8 19.2 29.866667 19.2 46.933333 0 17.066667-6.4 34.133333-19.2 46.933334l-138.666667 142.933333c-12.8 12.8-29.866667 19.2-49.066667 19.2z m0-373.333333c-6.4 0-12.8 2.133333-17.066666 6.4l-140.8 140.8c-4.266667 4.266667-6.4 10.666667-6.4 17.066666 0 6.4 2.133333 12.8 6.4 17.066667l140.8 140.8c4.266667 4.266667 10.666667 6.4 17.066666 6.4 6.4 0 12.8-2.133333 17.066667-6.4l140.8-140.8c4.266667-4.266667 6.4-10.666667 6.4-17.066667 0-6.4-2.133333-12.8-6.4-17.066666L768 113.066667c-4.266667-4.266667-8.533333-6.4-17.066667-6.4z m138.666667 853.333333h-277.333333c-36.266667 0-66.133333-29.866667-66.133334-66.133333v-277.333334c0-36.266667 29.866667-66.133333 66.133334-66.133333h277.333333c36.266667 0 66.133333 29.866667 66.133333 66.133333v277.333334c2.133333 36.266667-27.733333 66.133333-66.133333 66.133333zM614.4 590.933333c-12.8 0-25.6 10.666667-25.6 25.6v277.333334c0 12.8 10.666667 25.6 25.6 25.6h277.333333c12.8 0 25.6-10.666667 25.6-25.6v-277.333334c0-12.8-10.666667-25.6-25.6-25.6h-277.333333z" fill="#1E87EB" p-id="9446"></path></svg>
                    <span style="font-size: 16px;font-weight: bold;vertical-align: bottom;margin-left: 4px;">邮寄信息</span>
                </div>
                <el-form label-position="right" label-width="100px">
                    <el-form-item label="联系人：" class="star">
                        <el-input size="mini" readonly :value="detail.wp_user" style="width: 200px"></el-input>
                    </el-form-item>
                    <el-form-item label="联系电话：" class="star">
                        <el-input size="mini" readonly :value="detail.wp_phone" style="width: 200px"></el-input>
                    </el-form-item>
                    <el-form-item label="邮寄地址" class="star">
                        <el-input size="mini" readonly type="textarea" :value="detail.wp_province+detail.wp_city+detail.wp_area+detail.wp_address" style="width: 500px"></el-input>
                    </el-form-item>
                    <el-form-item label="付款截图" class="star">
                        <el-image :src="detail.images" fit="contian" :preview-src-list="[detail.images]" style="height: 150px;">
                            <div slot="error" class="image-slot">
                                <svg t="1718681716906" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2623" width="20" height="20"><path d="M400.696 268.795c-17.249 0-31.233 13.986-31.233 31.233v30.471c0 17.249 13.986 31.233 31.233 31.233s31.233-13.986 31.233-31.233v-30.471c0-17.249-13.985-31.233-31.233-31.233z" fill="#999999" p-id="2624"></path><path d="M623.649 361.734c17.249 0 31.234-13.986 31.234-31.233v-30.471c0-17.249-13.986-31.233-31.234-31.233s-31.233 13.986-31.233 31.233v30.471c-0.001 17.248 13.985 31.233 31.233 31.233z" fill="#999999" p-id="2625"></path><path d="M438.295 388.804c-14.656 9.104-19.155 28.362-10.050 43.013 11.209 18.047 41.976 48.59 86.157 48.59 43.958 0 75.1-30.313 86.574-48.223 9.303-14.529 5.068-33.847-9.455-43.15-14.539-9.298-33.852-5.068-43.15 9.455-0.122 0.199-13.38 19.45-33.969 19.45-20.009 0-32.444-18.128-33.278-19.373-9.166-14.423-28.28-18.805-42.829-9.761z" fill="#999999" p-id="2626"></path><path d="M824.508503 116.690676 571.592236 116.690676c-17.248849 0-31.233352 13.985526-31.233352 31.233352s13.985526 31.233352 31.233352 31.233352l252.916267 0c40.181141 0 72.878844 32.692586 72.878844 72.878844l0 396.966057-189.334159-165.29465c-12.20088-10.655687-30.517037-10.207479-42.173518 0.9967L468.578048 674.16231 309.521472 517.519714c-11.895935-11.70253-30.903847-12.002358-43.154869-0.645706L126.957507 646.163629l0-394.126382c0-40.186258 32.692586-72.878844 72.878844-72.878844l252.916267 0c17.248849 0 31.233352-13.985526 31.233352-31.233352S470.000444 116.690676 452.751594 116.690676L199.836351 116.690676c-74.632791 0-135.346571 60.71378-135.346571 135.346571l0 520.56405c0 74.632791 60.71378 135.346571 135.346571 135.346571l252.916267 0c17.248849 0 31.233352-13.985526 31.233352-31.233352s-13.985526-31.233352-31.233352-31.233352L199.836351 845.481164c-40.186258 0-72.878844-32.692586-72.878844-72.878844l0-41.23924 160.003134-148.385539 159.428036 157.007917c12.048407 11.865235 31.361265 11.981892 43.546795 0.274246l198.576661-190.68697 208.876238 182.346001 0 40.683585c0 40.186258-32.697703 72.878844-72.878844 72.878844L571.592236 845.481164c-17.248849 0-31.233352 13.985526-31.233352 31.233352s13.985526 31.233352 31.233352 31.233352l252.916267 0c74.627674 0 135.346571-60.71378 135.346571-135.346571L959.855074 252.037247C959.855074 177.404456 899.136178 116.690676 824.508503 116.690676z" fill="#999999" p-id="2627"></path></svg>
                            </div>
                        </el-image>
                    </el-form-item>
                </el-form>
            </el-row>
        </el-drawer>

        <!--审核进度-->
        <el-drawer title="调拨审批进度" :visible.sync="approvalVisible" size="650px" direction="rtl" :wrapperClosable="false" :before-close="closeBtn">
            <process-allocation v-if="approvalVisible" :runId="runId" :id="ipurchaseId" :type="'NG'"></process-allocation>
        </el-drawer>
    </section>
</template>

<script>
import {ipurchaseDetail, ipurchaseList} from "@/api/op/ipurchase";
import processAllocation from "@/view/components/flow/processAllocation";

export default {
    name: "op_ipurchases",
    components: {processAllocation},
    data() {
        return {
            tableHeight: window.innerHeight - 210,
            selectIndex: 0,
            btnLoading: false,
            loading: false,
            page: 1,
            limit: 20,
            total: 0,
            data: [],
            user: {},
            nodeActions: [],

            form:{allocation_number: "", adduser: "", status: "", createtime: []},

            drawerTableHeight: window.innerHeight - 85+"px",
            detailVisible: false,
            detail: {},

            //审批流程
            approvalVisible: false,
            runId: "",
            ipurchaseId: "",
        }
    },
    created() {
        this.user = this.$store.getters.user;
        this.nodeActions = this.user.node_actions[this.$route.meta.id] ? this.user.node_actions[this.$route.meta.id] : [];
    },
    methods: {
        //搜索按钮
        searchBtn() {
            this.page = 1;
            this.getData();
        },
        //翻页
        pageChange(page) {
            this.page = page;
            this.getData();
        },
        //获取数据
        getData() {
            let param = {
                page: this.page,
                limit: this.limit
            };
            param = Object.assign(this.form, param);
            this.loading = true;
            ipurchaseList(param).then((res) => {
                this.loading = false;
                this.total = res.data.total;
                this.data = res.data.data;
            }).catch(() => {
                this.loading = false;
            });
        },
        //详情
        detailBtn(allocationNumber){
            this.loading = true;
            ipurchaseDetail({allocation_number: allocationNumber}).then((res) =>{
                this.loading = false;
                this.detail = res.data;
                this.detailVisible = true;
            }).catch(()=>{
                this.loading = false;
            })
        },
        closeBtn(){
            this.approvalVisible = false;
        },
        processBtn(row){
            //审批流程
            this.approvalVisible = true;
            this.runId = row.approval_id;
            this.ipurchaseId = row.id;
        },
    },
    mounted() {
        this.searchBtn();
    }
}
</script>

<style scoped>
/deep/ .el-table__expanded-cell{
    margin: 0;padding: 0 0 0 40px;
}
.demo-table-expand /deep/ label {
    width: 80px;
    color: #99a9bf;
    font-size: 12px;
}
.demo-table-expand /deep/ div {
    font-size: 12px;
    color: #99a9bf;
}
.demo-table-expand /deep/ .el-form-item {
    margin-right: 0;
    margin-bottom: 0;
    width: 60%;
}

.star /deep/ .el-form-item__label::before {
    content: "* ";
    color: #F56C6C;
}
</style>
